﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Text;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NewStart
{
    class MetroHelper
    {
        public static string SearchIcon { get { return "\uE000"; } }
        public static string TwoUpArrowsIcon { get { return "\uE08D"; } }
        public static string TwoDownArrowsIcon { get { return "\uE00D"; } }
        public static string LeftArrowIcon { get { return "\uE016"; } }
        public static string RightArrowIcon { get { return "\uE017"; } }
        public static string UpArrowIcon { get { return "\uE018"; } }
        public static string DownArrowIcon { get { return "\uE019"; } }
        public static string DeleteTextIcon { get { return "\uE083"; } }
        public static string CircledForwardIcon { get { return "\uE0AC"; } }
        public static string CircledBackwardIcon { get { return "\uE0BA"; } }
        public static string PowerIcon { get { return "\uE07D"; } }
    }

    public enum MetroIcons
    {
        SearchIcon,
        TwoUpArrowsIcon,
        TwoDownArrowsIcon,
        LeftArrowIcon,
        RightArrowIcon,
        UpArrowIcon,
        DownArrowIcon,
        DeleteTextIcon,
        CircledForwardIcon,
        CircledBackwardIcon,
        PowerIcon,
    }

    public class Label : System.Windows.Forms.Label
    {
        private TextRenderingHint _textRenderingHint = TextRenderingHint.AntiAlias;

        public TextRenderingHint TextRenderingHint
        {
            get { return _textRenderingHint; }
            set { _textRenderingHint = value; }
        }

        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            e.Graphics.TextRenderingHint = _textRenderingHint;
            base.OnPaint(e);
        }
    }

    public class MetroIcon : Label
    {
        private MetroIcons icon = MetroIcons.CircledForwardIcon;

        public MetroIcons Icon
        {
            get { return icon; }
            set { icon = value; }
        }

        public override string Text
        {
            get
            {
                return (string)Type.GetType("NewStart.MetroHelper").GetProperty(Enum.GetName(Type.GetType("NewStart.MetroIcons"), icon)).GetValue(Type.GetType("NewStart.MetroHelper"), null);
            }
        }
    }

    public class BluePanel : System.Windows.Forms.Panel
    {
        public BluePanel()
        {
            this.Width = 39;
            this.Height = 71;
            this.Margin = new System.Windows.Forms.Padding(0);
        }

        protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent)
        {
            Graphics panel = this.CreateGraphics();
            Rectangle rBackground = new Rectangle(0, 0, 39, 71);
            System.Drawing.Drawing2D.LinearGradientBrush bBackground
               = new System.Drawing.Drawing2D.LinearGradientBrush(rBackground, Color.FromArgb(100, 170, 251), Color.FromArgb(50, 120, 211), 90);
            panel.FillRectangle(bBackground, rBackground);
            bBackground.Dispose();
        }
    }
}
